package org.callisto.model;

import java.util.ArrayList;
import java.util.List;

public class TimeSeries {
	int capacity;
	int size=0;
	List<TimeSeriesElement> list = new ArrayList<TimeSeriesElement>();
	ArrayList<TimeSeriesElement> queue = new ArrayList<TimeSeriesElement>();
	
	public TimeSeries(int capacity) {
		this.capacity = capacity;
	}
	
	public void append(TimeSeriesElement element) {
		queue.add(element);
		if (size == capacity) {
			queue.remove(0);	
		}
		queue.add(element);
	}
	
	public static void main(String args[]) {
		TimeSeries t=new TimeSeries(5);
		for (int i=0; i<5; i++) {
			TimeSeriesElement e=new TimeSeriesElement(i, (float) Math.random()); 
			t.append(e);
		}
	}
}
